﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DomainModel;
using Utils;
using System.ComponentModel.DataAnnotations;
using DataAnnotationsExtensions;

namespace WebUI.Models
{
    public class IndAddShotTagViewModel: BaseViewModel
    {
        public IndAddShotTagViewModel(Shot shot)
            : base(new { Shot = shot})
        { }

        public List<STag> ShotTagList { get; set; }
        public int ShotID { get; set; }
        //shot
        public Shot Shot { get; set; }
        //shot url
        public string ShotUrl { get; set; }

        protected override void SetVarsWhichDependOnDynamicParams(dynamic dynParams)
        {
            Shot = dynParams.Shot;
            ShotID = Shot.ShotID;
            ShotUrl = ImageUtils.GetShotRelativeUrl(Identity.AccountID, ShotID, ShotSizeEnum.Shot_450x300, Shot.FileExtension);
            ShotTagList = SqlUtilities.Query<STag>(ConstUtils.SP_GetShotTagListByID, new { IndID = Identity.AccountID, ShotID = ShotID }).ToList();
        }

        
    }
}